From: kfraser@localhost.localdomain Date: Thu, 12 Oct 2006 15:12:10 +0000 (+0100) Subject: [HVM][SVM] Check if SVM is disabled by the BIOS before enabling it. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15615^2~5 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=b3ec0ca6b6b4f2d8ee68e7aa655be8a859b9125d;p=xen.git [HVM][SVM] Check if SVM is disabled by the BIOS before enabling it. Newer BIOS implementations will be able to disable the SVM feature, although an additional test of an MSR (VMCR 0xC0010114 bit 4) is necessary (set equals disabled). Bit 4 of MSR 0xc0010114 returns 0 (SVM enabled) on machines with older BIOS' without the SVM disable feature support. Signed-off-by: Wei Huang =20 Signed-off-by: Tom Woller =20 --- diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 6d67980af4..ca4f8d52ae 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -840,6 +840,13 @@ int start_svm(void) if (!(test_bit(X86_FEATURE_SVME, &boot_cpu_data.x86_capability))) return 0; + + /* check whether SVM feature is disabled in BIOS */ + rdmsr(0xC0010114, eax, edx); + if ( eax & 0x00000010 ) { + printk("AMD SVM Extension is disabled in BIOS.\n"); + return 0; + } if (!(hsa[cpu] = alloc_host_save_area())) return 0;